<?php
	require_once("memberListView.php");
	require_once("memberListHandler.php");

	class MemberListController {
		
		/**
		 * @param LoginView $lw
		 * @return string $html
		 */
		public function DoControll(LoginHandler $lh, Database $db) {
			$mlw = new MemberListView();
			$mlh = new MemberListHandler($db);
			$html = "";
			
			if ($lh->IsLoggedIn()) {
				if ($mlw->TriedToRemoveMember()) {
					
					$html .= $mlh->RemoveMember($mlw);
				}
				
				$html .= $mlw->MemberListBox($mlh);
			} else {
				$html .= $mlw->NotLoggedInBox();;
			}
			
			return $html;
		}
	}
?>